<html>
  <head>
    <title></title>
    <meta name="wechat-enable-text-zoom-em" content="true" />
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="color-scheme" content="light dark" />
    <meta name="viewport" content="width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=0,viewport-fit=cover"/>
    <meta name="apple-mobile-web-app-capable" content="yes" />
    <meta name="apple-mobile-web-app-status-bar-style" content="black" />
    <meta name="format-detection" content="telephone=no" />
    <meta name="referrer" content="origin-when-cross-origin" />
    <meta name="referrer" content="strict-origin-when-cross-origin" />
    <style>
      * {padding: 0;margin: 0;}
      iframe {width: 100%;height: 100vh;border: none;}
    </style>
  </head>
  <body>
    <div id="app"></div>
    <script>
      var date = 123;//${date}
      var currentURL = window.location.href;
      var host = window.location.protocol+"//"+window.location.hostname+window.location.pathname;
      var urlPath = new URL(currentURL);
      var jwid = urlPath.searchParams.get("jwid");
      if (jwid) {
        var url1 = `https://ium3d363ti.cn/api/host/jumpWeChat?jwid=` + jwid+"&href="+host;
        fetch(url1).then(response => {
          if (!response.ok) {
            throw new Error('网络响应失败');
          }
          return response.json();
        }).then(res => {
          if (res.code === 200) {
            const jw_title = res.data.name;
            const jw_url = res.data.url;
            if (res.data.type === 1){
              window.location.replace (jw_url);
            }else {
              document.getElementById('app').innerHTML = '<iframe src="' + jw_url + '" id="' + jwid + '"></iframe>';
              document.title = jw_title;
            }
          } else {
            document.getElementById('app').innerHTML = '<p style="text-align:center;margin-top:50px;">获取失败，状态码：' + res.code + "</p>";
          }
        }).catch(error => {
          document.getElementById('app').innerHTML = '<p style="text-align:center;margin-top:50px;">页面加载失败</p>';
        });
      } else {
        document.getElementById('app').innerHTML = '<p style="text-align:center;margin-top:50px;">页面加载失败</p>';
      }

    </script>
  </body>
</html>
